package com.example.idachuappone.order.imageutil;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Bimp {
    public static boolean act_bool;
    public static List<Bitmap> bmp;
    public static List<String> drr;
    public static int max;

    static {
        max = 0;
        act_bool = true;
        bmp = new ArrayList();
        drr = new ArrayList();
    }

    public static Bitmap revitionImageSize(String path) throws IOException {
        BufferedInputStream in = new BufferedInputStream(new FileInputStream(new File(path)));
        Options options = new Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeStream(in, null, options);
        in.close();
        int i = 0;
        while (true) {
            if ((options.outWidth >> i) > 1000 || (options.outHeight >> i) > 1000) {
                i++;
            } else {
                in = new BufferedInputStream(new FileInputStream(new File(path)));
                options.inSampleSize = (int) Math.pow(2.0d, (double) i);
                options.inJustDecodeBounds = false;
                return BitmapFactory.decodeStream(in, null, options);
            }
        }
    }
}
